home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 10
/
AACD 10.iso
/
AACD
/
Online
/
SpeakFreely
/
src
/
lpc
/
lpctest.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-05-18
|
586b
|
33 lines
#include <stdio.h>
#include "lpc.h"
/*#define ENCODE/**/
/*#define DECODE/**/
main(argc, argv)
int argc;
char **argv;
{
int nbytes;
unsigned char buf[160];
lpcparams_t params;
lpcstate_t state;
fprintf(stderr, "S = %d\n", sizeof params);
lpc_init(&state);
#ifndef DECODE
while ((nbytes = read(0, buf, sizeof(buf))) > 0) {
lpc_analyze(buf, ¶ms);
#else
while ((nbytes = read(0, ¶ms, sizeof(params))) > 0) {
#endif
#ifdef ENCODE
write(1, ¶ms, sizeof params);
#else
lpc_synthesize(buf, ¶ms, &state);
write(1, buf, nbytes);
#endif
}
}